package com.edu.neusoft.elec_shop.domain;

import java.util.Date;
import lombok.Data;
import javax.validation.constraints.*;

@Data
public class Comments {

    @NotNull(message = "评论编号不能为空")
    private Long commenttId;

    @NotNull(message = "评论者ID不能为空")
    private Long userId;

    @NotNull(message = "评论的商品ID不能为空")
    private Long goodsId;

    @NotBlank(message = "商品名称不能为空")
    @Size(max = 100, message = "商品名称长度不能超过100个字符")
    private String goodsName;

    @PastOrPresent(message = "创建时间不能是未来的时间")
    private Date commentDate;

    @NotBlank(message = "评论内容不能为空")
    @Max(value = 500, message = "评论内容长度不能超过500个字符")
    @Min(value = 1, message = "评论内容长度不能小于1个字符")
    private String commentText;
}